package com.ktjiaotu.dynamicproxy;

import java.lang.reflect.Proxy;

/**
 * @Author: DABINGCHNEGJIAO
 * @CreateTime: 2025-06-05
 * @Description:
 * @Version: 1.0
 */
public class IntermediaryJdkProxyFactory {
    public static <T> T create(Object target) {
        IntermediaryIncocationHandler handler = new IntermediaryIncocationHandler();
        handler.setTarget(target);
        return (T) Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), handler);
    }
}
